package com.jiang.daily.Q3461;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/10/23 17:44
 */
class Solution {
    public boolean hasSameDigits(String s) {
        StringBuilder sb = new StringBuilder(s);
        while (sb.length() != 2) {
            StringBuilder temp = new StringBuilder();
            for (int i = 0; i < sb.length() - 1; i++) {
                int v = (sb.charAt(i) + sb.charAt(i + 1)) % 10;
                temp.append(v);
            }
            sb = temp;
        }
        return sb.charAt(0) == sb.charAt(1);
    }
}
